import request from '../utils/request';

export function serviceList() {
  return request(`api/auth/v1.0/service/list`);
}


export function actionList(params) {
  return request(`api/auth/v1.0/service_action/list?q=${params}`);
}


export function deleteService(params) {
  return request(`api/auth/v1.0/service?id=${params.id}`);
}


export async function addService(params) {
  return request(`api/auth/v1.0/service`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function updateService(params) {
    return request(`api/auth/v1.0/service?id=${params.id}`, {
      method: 'PUT',
      body: {
        ...params,
      },
    });
  }
  
  
export async function addServiceAction(params) {
  return request(`api/auth/v1.0/service_action`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function updateServiceAction(params) {
  return request(`api/auth/v1.0/service?id=${params.id}`, {
    method: 'PUT',
    body: {
      ...params,
    },
  });
}

export function deleteServiceAction(params) {
  return request(`api/auth/v1.0/service_action?id=${params.id}`,{
    method: 'DELETE'
  });
}